home *** CD-ROM | disk | FTP | other *** search
/ The Atari Compendium / The Atari Compendium (Toad Computers) (1994).iso / files / prgtools / gnustuff / tos / updates / update15.zoo / pml / pmlsrc / ccos.c < prev    next >
Encoding:
C/C++ Source or Header  |  1992-02-04  |  1.7 KB  |  82 lines

  1. /************************************************************************
  2.  *                                    *
  3.  *                N O T I C E                *
  4.  *                                    *
  5.  *            Copyright Abandoned, 1987, Fred Fish        *
  6.  *                                    *
  7.  *    This previously copyrighted work has been placed into the    *
  8.  *    public domain by the author (Fred Fish) and may be freely used    *
  9.  *    for any purpose, private or commercial.  I would appreciate    *
  10.  *    it, as a courtesy, if this notice is left in all copies and    *
  11.  *    derivative works.  Thank you, and enjoy...            *
  12.  *                                    *
  13.  *    The author makes no warranty of any kind with respect to this    *
  14.  *    product and explicitly disclaims any implied warranties of    *
  15.  *    merchantability or fitness for any particular purpose.        *
  16.  *                                    *
  17.  ************************************************************************
  18.  */
  19.  
  20. /*
  21.  *  FUNCTION
  22.  *
  23.  *    ccos   complex double precision cosine
  24.  *
  25.  *  KEY WORDS
  26.  *
  27.  *    ccos
  28.  *    complex functions
  29.  *    machine independent routines
  30.  *    math libraries
  31.  *
  32.  *  DESCRIPTION
  33.  *
  34.  *    Computes double precision complex cosine of a double
  35.  *    precision complex argument.
  36.  *
  37.  *  USAGE
  38.  *
  39.  *    COMPLEX ccos (z)
  40.  *    COMPLEX z;
  41.  *
  42.  *  REFERENCES
  43.  *
  44.  *    Fortran 77 user's guide, Digital Equipment Corp. pp B-12
  45.  *
  46.  *  PROGRAMMER
  47.  *    
  48.  *    Fred Fish
  49.  *    Tempe, Az 85281
  50.  *    (602) 966-8871
  51.  *
  52.  *  INTERNALS
  53.  *
  54.  *    Computes complex cosine of z = x + j y from:
  55.  *
  56.  *        1.    r_ccos = cos(x) * cosh(y)
  57.  *
  58.  *        2.    i_ccos = -sin(x) * sinh(y)
  59.  *
  60.  *        3.    ccos(z) = r_ccos + j i_ccos
  61.  *
  62.  */
  63.  
  64. #if defined (__M68881__) && !defined (_M68881)
  65. /*# define _M68881*/
  66. #endif
  67.  
  68. #include <stdio.h>
  69. #include <math.h>
  70. #include "pml.h"
  71.  
  72.  
  73. COMPLEX ccos (z)
  74. COMPLEX z;
  75. {
  76.     COMPLEX result;
  77.  
  78.     result.real = cos(z.real) * cosh(z.imag);
  79.     result.imag = -sin(z.real) * sinh(z.imag);
  80.     return (result);
  81. }
  82.